import request from '@/utils/request'
const baseUrl = '/plant/company'

export function getCompanyPage (pageParam,params) {
  return request({
    url: `${baseUrl}/${pageParam.pageNum}/${pageParam.pageSize}`,
    method: 'post',
    data: params
  })
}

export function saveCompany (data) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data: data
  })
}

export function deleteCompanyById (id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete',
  })
}

export function updateCompany (data) {
  return request({
    url: `${baseUrl}/${data.companyId}`,
    method: 'put',
    data: data
  })
}


export function getAllCompany () {
  return request({
    url: `${baseUrl}/getAll`,
    method: 'get',
  })
}
